<template>
    <div class="title-four" @click="linkTo">
        <span class="title-text" :style="`border-color: ${base.color}`">{{content.value}}</span>
    </div>
</template>

<script>
    export default {
        name: 'TitleFour',
        props: {
            content: {
                type: Object,
                default: _ => {
                    return {
                        value: '标题文字',
                        link: ''
                    };
                }
            },
            base: {
                type: Object,
                default: _ => {
                    return {
                        titleType: '',
                        color: 'rgba(248,89,89,1)'
                    };
                }
            }
        },
        methods: {
            linkTo() {
                let link = this.content.link;
                link && window.open(link);
            }
        }
    }
</script>

<style scoped lang="scss">
    .title-four {
        height: 100%;
        font-size: 20px;
        cursor: pointer;

        .title-text {
            height: 100%;
            max-width: 100%;
            box-sizing: border-box;
            display: inline-block;
            font-weight: 600;
            border-bottom: 2px solid transparent;
            overflow: hidden;
            line-height: 28px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }
</style>
